<template>
  <page-header-wrapper :title="false">
    <a-card :bordered="false">
      <a-tabs type="card" :tabBarGutter="8" v-model="tab" @change="onTabs">
        <a-tab-pane v-for="(item,index) in catOpts" :key="index">
          <div slot="tab">
            {{ item }}
          </div>
        </a-tab-pane>
      </a-tabs>
      <all v-if="tab == 1"></all>
      <trademark v-if="tab == 10"></trademark>
      <patent v-if="tab == 20"></patent>
      <copyright v-if="tab == 30"></copyright>
      <design v-if="tab == 40"></design>
      <international v-if="tab == 50"></international>
      <high-new v-if="tab == 60"></high-new>
      <assets v-if="tab == 70"></assets>
      <iso v-if="tab == 80"></iso>
      <gj-trademark v-if="tab == 90"></gj-trademark>
      <gj-patent v-if="tab == 100"></gj-patent>
      <three-a v-if="tab == 110"></three-a>
      <four-zero-zero v-if="tab == 120"></four-zero-zero>
      <other v-if="tab == 300"></other>
    </a-card>
  </page-header-wrapper>
</template>

<script>
  import { getAllBusiness } from '@/api/common'
  import All from '@/views/other/components/All'
  import Trademark from '@/views/other/components/Trademark'
  import Iso from '@/views/other/components/Iso'
  import Copyright from '@/views/other/components/Copyright'
  import Patent from '@/views/other/components/Patent'
  import International from '@/views/other/components/International'
  import Design from '@/views/other/components/Design'
  import HighNew from '@/views/other/components/HighNew'
  import Assets from '@/views/other/components/Assets'
  import Other from '@/views/other/components/Other'
  import GjTrademark from '@/views/other/components/GjTrademark'
  import GjPatent from '@/views/other/components/GjPatent'
  import ThreeA from '@/views/other/components/ThreeA'
  import FourZeroZero from '@/views/other/components/FourZeroZero'

  export default {
    components: {
      Other,
      Assets,
      HighNew,
      Design,
      International,
      Patent,
      Copyright,
      Iso,
      All,
      Trademark,
      GjTrademark,
      GjPatent,
      ThreeA,
      FourZeroZero
    },
    name: 'BusinessPrice',
    data () {
      return {
        visible: false,
        catOpts: {},
        tab: '1'
      }
    },
    created () {
      this.getBusinessByTab()
    },
    methods: {
      onTabs (key) {
        this.visible = false
        if (key !== '1' && key !== '80') {
          this.visible = true
        } else {
          this.visible = false
        }
      },
      getBusinessByTab () {
        getAllBusiness().then(res => {
          this.catOpts = res.result.category_opts
        })
      }
    }
  }
</script>

<style scoped>

</style>
